package com.simple.microservices.commons.token.dto;

import java.io.Serializable;
import java.util.UUID;

public class Token implements Serializable {

	private Long serialVersionUID = 1L;

	private final String key;

	private final String subjectId;

	private final String subjectClass;


	public Token(String subjectId, String subjectClass, String key) {
		this.subjectId = subjectId;
		this.subjectClass = subjectClass;
		this.key = key;

	}
	
	public Token(String subjectId, String subjectClass) {
		this.subjectId = subjectId;
		this.subjectClass = subjectClass;
		this.key = UUID.randomUUID().toString().replace("-", "");
	}

	public String getKey() { return key; }

	public String getSubjectId() { return subjectId; }

	public String getSubjectClass() { return subjectClass; }


}
